<style type="text/css">
.carousel-inner .item img{
	max-width: 100%;
    max-height: 100%;
    vertical-align: middle;
	height:82px;
}
.star-rate {margin-left:0}
.fe-floatright-bottom a {
    display: block;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 100%;
    background-color: #ff9999;
    color: #fff;
    line-height: 0.7rem;
	font-size:0.45rem;
    margin: 0.5rem auto;
    margin-right: 0;
}
.fe-floatright-bottom a .icon {
    color: #fff;
    font-size: 0.6rem;
    height: 0.6rem;
	line-height: 1rem;
    opacity: 1;
}
</style>

<div class='fui-page fui-page-current' ng-if="pagedata.op=='main'">
    <div class="fui-content" style="margin-bottom:2.2rem">
	<div class="sort" style="top:0.2rem">
		<div class="fui-list-group usergroup" style="background:#fff" ng-repeat="item in pagedata.list">
            <div class="fui-list">
                <div class="fui-list-media userlogo" href="javascript:;">
                    <img class="round" style="width:4rem;height:4rem" ng-src="{{tomedia(item.body.avatar) || '../core/resource/images/noavatar.gif'}}">
                </div>
               <div class="fui-list-inner userinfo" style="margin-top:0.16rem" href="javascript:;">
                    <div class="title" style="font-size:0.76rem;"><span>{{item.body.name}}</span><span style="float:right;color:red;font-size:0.65rem">{{item.classttile || '无班'}}</span></div>
					<div class="subtitle" style="-webkit-line-clamp:2;height:1.2rem">
						事由：{{item.remark}}
					</div>
					<div class="subtitle">
						时间：{{item.dayymb}} {{item.dayhour}} 《{{item.lessontitle}}》
					</div>
					<div class="text"><i class="fui-tag fui-tag-red">{{item.statustitle}}</i></div>
					<div ng-if="item.status==0" class="btn btn-sm btn-default-o order-delete r-f" style="margin-right:0.5rem" href="javascript:;" ng-click="post({},'jy_kexie/body_out/clenlset/id='+item.id)">取消请假</div>
                </div>
            </div>
		</div>
		<div ng-show="pagedata.loading" class='infinite-loading'><span class='fui-preloader'></span><span style="margin-left:1.5rem"> 正在加载...</span></div>
		<div class="content-empty" ng-show="!pagedata.list || pagedata.list.length == 0 ">
		  <i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><br/><p style="color: #999;font-size: .75rem">暂时没有添加小孩！</p> 
		</div>
	</div>
</div>
</div>
<div class='fui-page fui-page-current' ng-if="pagedata.op=='edit'">
    <div class='fui-content member-page'>
		<div class="fui-cell-group"  style="margin-top:0">
			<div class="fui-cell-title bold" style="padding: 0.5rem 0.65rem;">请假信息</div>
					<div class="weui_cells weui_cells_form" style="margin-top:-0.5rem">
					<div class="weui_cell">
						<div class="weui_cell_hd"><label class="weui_label">小孩照片</label></div>
						<div class="weui_cell_bd weui_cell_primary" >
							<ul class="weui_uploader_files">
							  <li class="weui_uploader_file" style="background-image:url({{tomedia(pagedata.body.avatar) || '../core/resource/images/noavatar.gif'}})"></li>
							</ul>
						</div>
					</div>
					<div class="weui_cell">
						<div class="weui_cell_hd"><label class="weui_label">小孩姓名</label></div>
						<div class="weui_cell_bd weui_cell_primary">
							<input ng-model="pagedata.body.name" readonly="true" class="weui_input" type="text" placeholder="请输入小孩姓名">
						</div>
					</div>
					</div>
					<div class="weui_cells_title">请假日期</div>
					<div class="fui-tab-scroll weui_cells_radio3" style="height: 3.2rem;overflow-y:hidden">
						<div  class="fui-icon-col" ng-repeat="item in pagedata.data" style="height: 3.2rem">
							<label class="jyui_cell_col">
								<div ng-class="{'coltime':1,'colchecked':pagedata.post.dayid==$index}" ng-click="getdata(pagedata.class.id,$index);pagedata.post.dayid=$index;">
									<div class="timetitle"><span>{{item.riqi}}</span></div>
									<div class="timetitle"><span>{{item.xinq}}</span></div>
								</div>
							</label>
						</div>
					</div>
		
					<div class="weui_cells_title">请选择请假课程</div>
					<div class="weui_cells">
						<div ng-repeat="row in pagedata.lesson_time" class="jy-3">
							<div ng-if="row.show==1" ng-class="{'yuyue-duan':1,'timeischack':pagedata.post.timeid == $index}" ng-click="pagedata.post.timeid=$index;pagedata.post.lesson_id=row.lessonid;pagedata.post.dayymb=row.dayymb;pagedata.post.dayhour=row.dayhour">
								<div>{{row.time.start}}~{{row.time.end}}</div>
								<div>({{row.lessontitle ||'课程'}})</div>
								<div class="clear"></div>
							</div>
							<div ng-if="row.show!=1" class="yuyue-duan disabled">
								<div>{{row.time.start}}~{{row.time.end}}</div>
								<div>({{row.lessontitle ||'课程'}})</div>
								<div class="clear"></div>
							</div>
						</div>
						<div class="content-empty" style="margin-top:0.2rem" ng-show="!pagedata.lesson_time || pagedata.lesson_time.length == 0 ">
						  <i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><br/><p style="color: #999;font-size: .75rem">当天没有任何课程！</p>
						</div>
					</div>
					<div class="weui_cells" style="margin-top:0">
					<div class="weui_cell">
						<div class="weui_cell_hd"><label class="weui_label">请假事由</label></div>
						<div class="weui_cell_bd weui_cell_primary">
							<textarea class="weui_textarea" style="padding:0.2rem;border-radius: 0.2rem;background-color:#eee" rows="5" placeholder="50字以内（必填）" ng-model="pagedata.post.remark"></textarea>
						</div>
					</div>
					</div>
			
		</div>
		<div class="weui_btn_area" style="margin:1rem 4rem 3.8rem 4rem">
				<a  class="weui_btn weui_btn_red" style="border-radius:1rem" href="javascript:" ng-click="post(pagedata.post,'jy_kexie/body_out/post/')">提交申请</a>
		</div>
</div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script type="text/javascript">
//手机软键盘--搜索
$("body").keydown(function() {
    if (event.keyCode == "13") {
        $('#searchsub').click();
    }
});
scope.pagedata.loading = true;
scope.pagedata.type=0
scope.tool.get_list('jy_kexie/body_out/getlist/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_kexie/body_out/getlist/');
}
scope.getdata = function(id,dayid){
		console.log(dayid);
		scope.pagedata.post.timeid='no'
		var params1 = {
					'plugin':'jy_kexie',
					'action':'body_out',
					'op':'lesson_time',
					'query':'id='+id+'&day='+dayid,
					'data':{},
					'callback':function(data){
							//console.log(data)
							if(data.success == 1){
									scope.pagedata.lesson_time = data.lesson_time;
									scope.$evalAsync();
							}
					}
		}
		scope.post_json(params1);
}
if(scope.pagedata.class){
	scope.getdata(scope.pagedata.class.id,scope.pagedata.post.dayid);
}
</script>